import React from 'react'
const { $fn, $Lazy } = window
// ===================================================================== private template
const Menu = $Lazy.load(()=>import('#frame/menu'))
// ===================================================================== public
const permissions = { title: '关联权限库', path: 'permissions', cache:true, component:'system-manage/_public/permissions' }
// ===================================================================== 系统管理
class Index extends React.Component{
	state = {
		data:[]
	}
	
	skip = { to: 'system-manage/process-manage/process-list' }
	
	child = [
		/* 流程管理 */
		// 流程列表
		{ 
			id: 'lcqx', 
			parent: '/system-manage/process-manage/process-list',
			children: [
				{ title: '节点列表', path: 'node-list', cache:true, component:'system-manage/process-manage/node-list',
					children:[
						{ title: '流程授权列表', path: 'process-permission-list', cache:true, component:'system-manage/process-manage/process-permission-list',
							children:[
								permissions
							]
						}
					]
				}
			]
		},
		// 节点列表
		{
			id: 'lcqx', 
			parent: '/system-manage/process-manage/node-list',
			children: [
				{ title: '流程授权列表', path: 'process-permission-list', cache:true, component:'system-manage/process-manage/process-permission-list',
					children:[
						permissions
					]
				}
			]
		},
		// 流程授权列表
		{
			id: 'lcqx', 
			parent: '/system-manage/process-manage/process-permission-list',
			children: [
				permissions
			]
		},
		// 权限管理
		{ 
			id: 'qxgl', 
			parent: '/system-manage/authority/position-list',
			children: [
				permissions
			]
		},
		{
			id: 'qxgl', 
			parent: '/system-manage/authority/group-list',
			children: [
				permissions
			]
		},
		{
			id: 'qxgl', 
			parent: '/system-manage/authority/role-list',
			children: [
				permissions
			]
		},
		// 组织管理
		{
			id: 'zzgl', 
			parent: '/system-manage/organizational-manage/company-manage',
			children: [
				{ title: '部门管理', path: 'department-manage', cache:true, component:'system-manage/organizational-manage/department-manage',
					children:[
						{ title: '科室管理', path: 'keshi-manage', cache:true, component:'system-manage/organizational-manage/keshi-manage',
							children: [
								{ title: '岗位管理', path: 'post-manage', cache:true, component:'system-manage/organizational-manage/post-manage',
									children:[
										{ title: '员工管理', path: 'employee-manage', cache:true, component:'system-manage/organizational-manage/employee-manage',
											children:[
												permissions
											]
										}
									]
								}
							]
						}
					]
				}
			]
		},
		{
			id: 'zzgl', 
			parent: '/system-manage/organizational-manage/department-manage',
			children: [
				{ title: '科室管理', path: 'keshi-manage', cache:true, component:'system-manage/organizational-manage/keshi-manage',
					children: [
						{ title: '岗位管理', path: 'post-manage', cache:true, component:'system-manage/organizational-manage/post-manage',
							children:[
								{ title: '员工管理', path: 'employee-manage', cache:true, component:'system-manage/organizational-manage/employee-manage',
									children:[
										permissions
									]
								}
							]
						}
					]
				}
			]
		},
		{
			id: 'zzgl',
			parent: '/system-manage/organizational-manage/keshi-manage',
			children: [
				{ title: '岗位管理', path: 'post-manage', cache:true, component:'system-manage/organizational-manage/post-manage',
					children:[
						{ title: '员工管理', path: 'employee-manage', cache:true, component:'system-manage/organizational-manage/employee-manage',
							children:[
								permissions
							]
						}
					]
				}
			]
		},
		{
			id: 'zzgl',
			parent: '/system-manage/organizational-manage/post-manage',
			children: [
				{ title: '员工管理', path: 'employee-manage', cache:true, component:'system-manage/organizational-manage/employee-manage',
					children:[
						permissions
					]
				}
			]
		},
		{
			id: 'zzgl',
			parent: '/system-manage/organizational-manage/employee-manage',
			children: [
				permissions
			]
		},
		// 字典维护
		{
			id: 'adwh',
			parent: '/system-manage/dictionary-maintenance/dictionary-class',
			children: [
				{ title: '字典内容', path: 'data-dictionary', cache:true, component:'system-manage/dictionary-maintenance/data-dictionary' }
			]
		},
		// 消息列表
		{
			id: 'xilb',
			parent: '/system-manage/message/notice',
			children: [
				{ title: '字典内容', path: 'detail', cache:true, component:'workbench/info/detail' }
			]
		},
		// 待办管理
		{
			id: 'dbgl',
			parent: '/system-manage/todo-manage',
			children: [
				{ title: '待办详情', path: 'detail', cache:true, component:'system-manage/todo-manage/detail' }
			]
		}
	]
	
	componentDidMount(){
		$fn.getMenu.call(this, 'tygl', this.child)
	}
	
	render(){
		return <Menu data={this.state.data} skip={ this.skip } />
	}
}

export default Index